package com.js.demo06;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.geometry.Rectangle2D;
import javafx.stage.Screen;
import javafx.stage.Stage;

public class Demo extends Application
{
//    第3课初步认识stage窗口
    @Override
    public void start(Stage stage) throws Exception {
        stage.setTitle("Hello World");
        stage.setWidth(400);
        stage.setHeight(400);

        Screen screen = Screen.getPrimary();
        Rectangle2D bounds = screen.getBounds();
        Rectangle2D visualBounds = screen.getVisualBounds();

        System.out.println("screen bounds: " + bounds.getMinY() + " " + bounds.getMinX() + " " + bounds.getMaxY() + " " + bounds.getMaxX());
        System.out.println("screen visualBounds: " + visualBounds.getMinY() + " " + visualBounds.getMinX() + " " + visualBounds.getMaxY() + " " + visualBounds.getMaxX());

        stage.show();
        Platform.exit();
    }

    @Override
    public void init() throws Exception {
        super.init();
        System.out.println("init");
    }

    @Override
    public void stop() throws Exception {
        super.stop();
        System.out.println("stop");
    }
}
